package com.iflytek.universitymanagement.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iflytek.universitymanagement.domain.Course;
import com.iflytek.universitymanagement.mapper.CourseMapper;
import com.iflytek.universitymanagement.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> implements CourseService {

//    @Resource
//    CourseMapper courseMapper;

    @Autowired
    private CourseMapper courseMapper;  // 注入 Mapper，假设 CourseMapper 已经有了

    @Override
    public String getCourseNameById(int courseId) {
        // 假设你使用 MyBatis，查询课程名称
        return courseMapper.findCourseNameById(courseId);
    }

    @Override
    public List<Course> getAllCourses() {
        return list();
    }
}
